package com.hyk.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hyk.dto.ApiResult;
import com.hyk.entity.DataSourceX;
import com.hyk.service.IDataSourceXService;
import com.hyk.utils.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 数据源表 前端控制器
 * </p>
 *
 * @author hyk
 * @since 2021-03-10
 */
@RestController
@RequestMapping("/data-source-x")
@Api(tags = "项目数据源控制器")
@CrossOrigin
public class DataSourceXController {

    @Resource
    private IDataSourceXService dataSourceXService;

    @PostMapping("/list")
    public ApiResult list(){
        QueryWrapper<DataSourceX> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete",0);
        queryWrapper.eq("status",0);
        List<DataSourceX> list = dataSourceXService.list(queryWrapper);
        return R.ok(list);
    }

}
